/*
 * Copyright (c) 2015, 张涛.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.yuexunit.operationman.nbsy.base;

import android.app.Application;
import android.content.Context;

import com.facebook.stetho.Stetho;
import com.yuexunit.operationman.nbsy.util.CrashHandler;

public class AppContext extends Application {

    public static int screenW;
    public static int screenH;
    private static Context appContext;
    public static boolean isRelease;


    @Override
    public void onCreate() {
        super.onCreate();
        appContext = this.getApplicationContext();
        CrashHandler.create(this);
        //初始化Log4j配置
//        SetLog4jParams();
        //启动Chrome调试App
//        StartStetho();
    }


//    private void SetLog4jParams() {
//        new Thread(new Runnable() {
//            @Override
//            public void run() {
//                org.apache.log4j.Logger root = org.apache.log4j.Logger.getRootLogger();
//                final SocketAppender appender = new SocketAppender("158.18.1.196", 6101);
//                appender.setLocationInfo(true);
//                root.addAppender(appender);
//                Logger logger = LoggerFactory.getLogger(this.getClass());
//            }
//        }).start();
//    }

    private void StartStetho() {
        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(
                                Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(
                                Stetho.defaultInspectorModulesProvider(this))
                        .build());


    }


}
